1. Field of the Invention
The invention relates to a method and apparatus for performing color space conversion, more particularly to a method and apparatus with reduced look-up tables for converting digitized luminance-chrominance color space signals to digitized RGB color space signals.
2. Description of the Related Art
It is desirable to merge a video signal with graphic signals in a multi-media computer system. The video signal may come from a television image processing system having a capture or frame grabbing capability, or from a compressed video playback of a CD-ROM or network transmission. Color space conversion is needed in image processing applications to convert luminance-chrominance color space signals, which offer the advantages of a lower transmission bandwidth and a lower data storage requirement, into RGB color space signals, which are used when displaying an image on a computer monitor.
CCIR 601, which was proposed by the Comite Consultatif International des Radiocommunications (CCIR), establishes the following formulas for converting from the YCbCr luminance-chrominance color space to the RGB color space:
R=Y+1.402(Cr-128)xe2x80x83xe2x80x83(a.1)
G=Yxe2x88x920.714(Cr-128)xe2x88x920.344(Cb-128)xe2x80x83xe2x80x83(a.2)
B=Y+1.772(Cb-128)xe2x80x83xe2x80x83(a.3)
If U and V are used to represent the shifted chrominance components (Cb-128) and (Cr-128), respectively, Equations (a.1) to (a.3) can be rewritten as follows:
R=Y+1.402Vxe2x80x83xe2x80x83(b.1)
G=Yxe2x88x920.714Vxe2x88x920.344Uxe2x80x83xe2x80x83(b.2)
B=Y+1.772Uxe2x80x83xe2x80x83(b.3)
where Y ranges between [0, 255], and U and V range between [xe2x88x92128, 127] in an 8-bit representation for each of the Y, Cb and Cr color space components.
Color space conversion is often implemented by employing multipliers or look-up tables to achieve the matrix multiplication operations. Look-up tables are preferred because of their less complicated constructions. It is noted that the matrix multiplication operations dominate the hardware complexity of a color space converting apparatus. As such, the number of look-up tables is critical in determining the cost of implementing the color space converting apparatus. To implement the YCbCr to RGB color space conversion of Equations (a.1) to (a.3), a conventional color space converter usually requires four look-up tables to perform the matrix multiplication of chrominance components. Although the use of four look-up tables is less expensive to implement as compared to another conventional color space converter which uses a 3-by-3 multiplication matrix, a further reduction in the number of look-up tables is desirable.
In a co-pending U.S. Patent Application, entitled xe2x80x9cMethod AndApparatus Requiring Fewer Number of Look-Up Tables For Converting Luminance Chrominance Color Space Signals To RGB Color Space Signals,xe2x80x9d and filed on Jun. 10, 1997 by the Applicant, it has been proposed that, by linearly combining the conversion formulas, equations (b.1) to (b.3) can be rearranged as follows to result in RGB color combination signals:
Rxe2x88x92G=0.714(2V)+0.344(U+2V)xe2x80x83xe2x80x83(c.1)
Bxe2x88x92G=0.714(2U+V)+0.344(2U)xe2x80x83xe2x80x83(c.2)
R+Bxe2x88x92G=Y+0.714(2U+2V)+0.344(2U+2V)xe2x80x83xe2x80x83(c.3)
B+G=2Y+0.714(2Uxe2x88x92V)xe2x80x83xe2x80x83(c.4)
R+G=2Y+0.344(2Vxe2x88x92U)xe2x80x83xe2x80x83(c.5)
Equations (c.1) to (c.5) list a set of possible linear combinations of equations (b.1) to (b.3). Consequently, as Equations (c.1) to (c.5) use only two coefficients, namely 0.714 and 0.344, for matrix multiplications, no more than two look-up tables may be used to convert luminance-chrominance color space signals to RGB color combination signals. Therefore, conversion from the luminance-chrominance color space to the RGB color space can be implemented using fewer than four look-up tables by converting the luminance-chrominance color space signals to the RGB color combination signals expressed as a function of predetermined linear combinations of the chrominance color space signals as defined by the appropriate conversion formulas, and by linearly combining the resulting RGB color combination signals to obtain the RGB color space signals.
The apparatus disclosed in the aforementioned U.S. Patent Application comprises: a first combining unit for generating a plurality of linear combinations of the chrominance color space signals and at least one binary combination of the luminance color space signal; a multiplexed multiplication unit connected to the first combining unit to receive the linear combinations of the chrominance color space signals therefrom, the multiplexed multiplication unit including no more than two look-up tables which contain digitized transformation values for performing matrix multiplications of the linear combinations of the chrominance color space signals; a second combining unit connected to the multiplexed multiplication unit and the first combining unit, the second combining unit linearly combining the digitized transformation values outputted by the multiplexed multiplication unit and the binary combination of the luminance color space signal to generate three RGB color combination signals; and a third combining unit connected to the second combining unit, the third combining unit linearly combining the RGB color combination signals to obtain the RGB color space signals.
While the apparatus of the aforementioned U.S. Patent Application permits conversion of digitized luminance-chrominance color space signals to digitized RGB color space signals using less than four look-up tables, it is desirable to further reduce the sizes of the look-up tables used therein so that a cost-effective hardware implementation can be achieved.
Therefore, the main object of the present invention is to provide a color space converting method and apparatus which employs a small number of look-up table units to implement the matrix multiplication operations when converting digitized luminance-chrominance color space signals to digitized RGB color space signals.
More specifically, the object of the present invention is to provide a color space converting method and apparatus in which plural matrix multiplications that are associated with the same chrominance signal are jointly implemented using a single look-up table unit to result in a small number of the look-up table units for converting digitized luminance-chrominance color space signals to digitized RGB color space signals.
Another object of the present invention is to provide a color space converting method and apparatus which employs coded look-up table units of reduced sizes to implement the matrix multiplication operations when converting digitized luminance-chrominance color space signals to digitized RGB color space signals, thereby resulting in a relatively inexpensive but highly efficient construction.
According to one aspect of the invention, in a method for converting digitized luminance-chrominance color space signals to digitized RGB color space signals, first, second, third and fourth matrix multiplication operations of the digitized chrominance color space signals are first performed. The first matrix multiplication operation has a first result to be used in conversion for the digitized R color space signal. The second and third matrix multiplication operations have second and third results to be used in conversion for the digitized G color space signal. The fourth matrix multiplication operation has a fourth result to be used in conversion for the B color space signal. One of the first and fourth matrix multiplication operations and one of the second and third matrix multiplication operations are associated with the same one of the digitized chrominance color space signals and are jointly implemented in a single look-up table unit.
According to another aspect of the invention, an apparatus for converting digitized luminance-chrominance color space signals to digitized RGB color space signals comprises means for performing first, second, third and fourth matrix multiplication operations of the digitized chrominance color space signals. The first matrix multiplication operation performing means has a first result to be used in conversion for the digitized R color space signal. The second and third matrix multiplication operation performing means have second and third results to be used in conversion for the digitized G color space signal. The fourth matrix multiplication operation performing means has a fourth result to be used in conversion for the B color space signal. One of the first and fourth matrix multiplication operations performed by one of the first and fourth matrix multiplication operation performing means, and one of the second and third matrix multiplication operations performed by one of the second and third matrix multiplication operation performing means are associated with the same one of the digitized chrominance color space signals. Said one of the first and fourth matrix multiplication operation performing means and said one of the second and third matrix multiplication operation performing means are jointly implemented in a single look-up table unit.
Preferably, the look-up table unit has first and second outputs, and outputs a corresponding codeword that contains a first transformation code corresponding to the result of said one of the first and fourth matrix multiplication operation performing means at the first output, and a second transformation code corresponding to the result of said one of the second and third matrix multiplication operation performing means at the second output when the look-up table unit is addressed by the same one of the digitized chrominance color space signals.
In one embodiment, the look-up table unit includes a first data field which contains the first transformation codes, and a second data field which contains the second transformation codes.
In another embodiment, the look-up table unit includes a look-up table portion which has an average data field and an error data field. The average data field contains average conversion codes which are average codes of the first and second transformation codes. The error data field contains error conversion codes which are differences between the average conversion codes and corresponding ones of the first and second transformation codes. The look-up table portion outputs one of the average conversion codes and the corresponding one of the error conversion codes when addressed by the same one of the digitized chrominance color space signals. First combining means, such as an adder, combines an outputted one of the average conversion codes and the corresponding one of the error conversion codes to generate the corresponding one of the first transformation codes at the first output. Second combining means, such as a subtracter, combines the outputted one of the average conversion codes and the corresponding one of the error conversion codes to generate the corresponding one of the second transformation codes at the second output.
Preferably, the apparatus further comprises means for performing arithmetic shift operations of at least one of the digitized chrominance color space signals to obtain a plurality of binary conversion codes of said at least one of the digitized chrominance color space signals having coefficients of integral powers of 2. The first result of the first matrix multiplication operation performing means, the digitized luminance color space signal, and at least one of the digitized chrominance color space signals and the binary conversion codes are combined to obtain a first resultant sum, and the first resultant sum is clipped to a range that represents binary code of the R color space signal. The second and third results of the second and third matrix multiplication operation performing means, the digitized luminance color space signal, and at least one of the digitized chrominance color space signals and the binary conversion codes are combined to obtain a second resultant sum, and the second resultant sum is clipped to a range that represents binary code of the G color space signal. The fourth result of the fourth matrix multiplication operation performing means, the digitized luminance color space signal, and at least one of the digitized chrominance color space signals and the binary conversion codes are combined to obtain a third resultant sum, and the third resultant sum is clipped to a range that represents binary code of the B color space signal.